import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import TypeNav from '@/components/TypeNav'
import Pagination from '@/components/Pagination'
import Dialog from '@/components/Dialog'

// 启动mock服务器
import '@/mockServer'

// 统一引入轮播图的样式
import 'swiper/css/swiper.css'

// 引入element-ui
import { Button,Message } from 'element-ui'

import  VueLazyload from 'vue-lazyload'
import loadgif from '@/assets/loading.gif'

Vue.use(VueLazyload,{
  loading: loadgif
})

Vue.component(Button.name,Button);
Vue.component(Message.name,Message);
Vue.prototype.$message = Message;

// 将Pagination注册为全局组件
Vue.component(Pagination.name,Pagination)

// 关闭Vue生产提示
Vue.config.productionTip = false

// 全局注册TypeNav
Vue.component(TypeNav.name,TypeNav)
Vue.component(Dialog.name,Dialog)

new Vue({
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this
  },
  router,
  store,
  // mockServer
}).$mount('#app')